﻿<div v-cloak>
    <div v-if="controltype=='upload'">
        <el-upload :action="uploadUrl" :on-preview="handlePreview" :on-remove="handlerRemove"
            :before-remove="beforeRemove" :on-success="handleSuccess" :before-upload="beforeUpload" :data="uploadData"
            :file-list="fileList" :disabled="readonly" :style="{width:uploadWidth+'px'}">
            <el-button size="small" type="primary" v-show="!readonly">{{uploadButtonText}}</el-button>
            <div slot="tip" class="el-upload_tip" v-show="!readonly">{{uploadTipText}}</div>
        </el-upload>
    </div>
    <div v-if="controltype=='image'">
        <div v-if imagetype='single'>
            <el-upload class="avatar-uploader" :action="uploadUrl" :show-file-list="false"
                :on-success="handleSingleImgSuccess" :before-upload="beforeUpload" :data="uploadData">
                <img v-if="imageUrl" :src="imageUrl" class="avatar">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
        </div v-if>
    </div>
    <div v-if="controltype=='import'">
        <el-upload :action="importUrl" :before-upload="beforeUpload" :on-success="handleSuccess" :data="importData" 
        :show-file-list="false" :style="{width:uploadWidth+'px'}" multiple>
            <el-button  type="primary" v-show="!readonly" :id="importButtonnName">{{uploadButtonText}}</el-button>
            <div slot="tip" class="el-upload_tip" v-show="!readonly">{{uploadTipText}}</div>
        </el-upload>
    </div>
</div>